<template>
	<div class="page1">
		<img src="../assets/images/zhanhui/top.png" width="100%" />
		<p>平安普惠助力小微企业成长<br />暨宅e经营贷
				“畅享” 版发布会</p>
		<router-link :to="{name: 'Sign'}" v-if="user.mobile">观看直播</router-link>
		<router-link :to="{name: 'Sign'}" v-else>立即签到</router-link>
	</div>
</template>

<script>
import { getActiveInfo } from '@/api/user'
import { share } from '@/api/app.js'

export default {
	components: {
    
  },
  data() {
    return {
    	user: this.$store.state.user,
    	info: this.$store.state.active,

    };
  },
  created() {
  	
  	this.getShare()
  	
  },
  methods: {
    getShare() {
      share({url: location.href.split('#')[0]}).then(res=> {
        var jweixin = require('jweixin-module')
        jweixin.config(JSON.parse(res))
        let _this = this
        jweixin.ready(function(){
          let title = _this.info.name
          let desc = _this.info.fname
          let img = _this.info.haibao
          let link = window.origin + process.env.VUE_APP_PATH
          console.log(link)
          jweixin.updateAppMessageShareData({ 
            title: title, // 分享标题
            desc: desc, // 分享描述
            link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: img, // 分享图标
            success: function () {
              // 设置成功
            }
          })
          jweixin.updateTimelineShareData({ 
            title: title, // 分享标题
            link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: img, // 分享图标
            success: function () {
              // 设置成功
            }
          })
          
        })
      })
    }
  }
};	
</script>

<style>
	.page1{
		width: 100%;
		height: 100vh;
		background-color: #fff;
		overflow: hidden;
	}
	.page1 img{
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1;
	}
	.page1 p{
		text-align: center;
		color: #fa7148;
		font-size: .42rem;
		margin-top: 7.5rem;
		line-height: .6rem;
		font-weight: bold;
	}
	.page1 a{
		color: #fd5d3e;
		font-size: .33rem;
		line-height: .7rem;
		border: 2px solid #fd5d3e;
		display: block;
		margin: auto;
		width: 2.5rem;
		text-align: center;
		border-radius: 20px;
		margin-top: .6rem;
		font-weight: bold;
	}
</style>
